#include "aruco_test.h"
#include <memory>

using namespace aruco_node;

int main(int argc, char** argv)
{
    std::cout << "Hello ArUco!" << std::endl;
    int arucoFormatId = 10;
    std::shared_ptr<ArucoTest> aruco_creator = std::make_shared<ArucoTest>(arucoFormatId); // 需要头文件memory

    cv::VideoCapture cap(0);
 
    cap.set(cv::CAP_PROP_FRAME_WIDTH, 640);
    cap.set(cv::CAP_PROP_FRAME_HEIGHT, 480);
    cap.set(cv::CAP_PROP_FPS, 30);

    cv::Mat frame;

    if(!cap.isOpened())
    {
        std::cout << "Please check the usb_number." << std::endl;
        return(-1);
    }

    while (true)
    {
        cap >> frame;
        aruco_creator->detete_aruco(frame);
        cv::imshow("inputImage", frame);
        char key = cv::waitKey(10);
        if ( key == 'q')
            break;
    }
    

    return 0;
}